﻿{include file="index/header" /}

				<div class="main-content">
					<div class="breadcrumbs" id="breadcrumbs">
						<script type="text/javascript">
							try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
						</script>

						<ul class="breadcrumb">
							<li>
								<i class="icon-home home-icon"></i>
								<a href="{:url('index')}">销售列表</a>
							</li>
							<li class="active">
								修改销售信息
							</li>
						</ul>
					</div>

					<div class="page-content">

						<div class="row">
							<div class="col-xs-12">
								<!-- PAGE CONTENT BEGINS -->

								<div class="alert alert-block alert-success">
									<button type="button" class="close" data-dismiss="alert">
										<i class="icon-remove"></i>
									</button>

									<i class="icon-ok green"></i>

									欢迎使用
									<strong class="green">
										Ace后台管理系统
										<small>(v1.2)</small>
									</strong>
									,轻量级好用的后台管理系统模版.
								</div>
								<div class="row">
									<div class="col-xs-12">
										<h3 class="header smaller lighter blue">
											编辑销售
										</h3>
										<form class="form-horizontal"  method="post" action="{:url('edit')}">
											<div class="form-group">
												<label class="col-sm-3 control-label no-padding-right">用户名</label>

												<div class="col-sm-9">
													<input type="text" name="username" class="col-xs-10 col-sm-5" value="{$list.username}"/>
												</div>
											</div>

											<div class="space-4"></div>

											<div class="form-group">
												<label class="col-sm-3 control-label no-padding-right">手机号</label>

												<div class="col-sm-9">
													<input type="text" name="phone" class="col-xs-10 col-sm-5" value="{$list.phone}" />
												</div>
											</div>
											<div class="space-4"></div>

											<div class="form-group">
												<label class="col-sm-3 control-label no-padding-right">状态</label>

												<div class="col-sm-9">
													<select name="status" class="col-xs-10 col-sm-5">
														<option value="1" {if $list.status == 1} selected{/if}>启用</option>
														<option value="2" {if $list.status == 2} selected{/if}>禁用</option>
													</select>
												</div>
											</div>
											<input type="hidden" name="id" value="{$list.id}">
											<div class="space-4"></div>

											<div class="clearfix form-actions">
												<div class="col-md-offset-3 col-md-9">
													<button class="btn btn-info" type="submit">
														<i class="icon-ok bigger-110"></i>
														提交
													</button>
												</div>
											</div>
										</form>
									</div>
								</div>
								<!-- PAGE CONTENT ENDS -->
							</div><!-- /.col -->
						</div><!-- /.row -->
					</div><!-- /.page-content -->
				</div><!-- /.main-content -->
			</div><!-- /.main-container-inner -->

			<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
				<i class="icon-double-angle-up icon-only bigger-110"></i>
			</a>
		</div><!-- /.main-container -->

		<!-- basic scripts -->

		<script src="__STATIC__/assets/js/jquery.min.js"></script>

		<script type="text/javascript">
			window.jQuery || document.write("<script src='__STATIC__/assets/js/jquery-2.0.3.min.js'>"+"<"+"script>");
		</script>

		<!-- <![endif]-->

		<!--[if IE]>
<script type="text/javascript">
 window.jQuery || document.write("<script src='__STATIC__/assets/js/jquery-1.10.2.min.js'>"+"<"+"script>");
</script>
<![endif]-->

		<script type="text/javascript">
			if("ontouchend" in document) document.write("<script src='__STATIC__/assets/js/jquery.mobile.custom.min.js'>"+"<"+"script>");
		</script>
		<script src="__STATIC__/assets/js/bootstrap.min.js"></script>
		<script src="__STATIC__/assets/js/typeahead-bs2.min.js"></script>

		<!-- page specific plugin scripts -->

		<!--[if lte IE 8]>
		  <script src="__STATIC__/assets/js/excanvas.min.js"></script>
		<![endif]-->

		<script src="__STATIC__/assets/js/jquery-ui-1.10.3.custom.min.js"></script>
		<script src="__STATIC__/assets/js/jquery.ui.touch-punch.min.js"></script>
		<script src="__STATIC__/assets/js/jquery.slimscroll.min.js"></script>
		<script src="__STATIC__/assets/js/jquery.easy-pie-chart.min.js"></script>
		<script src="__STATIC__/assets/js/jquery.sparkline.min.js"></script>
		<script src="__STATIC__/assets/js/flot/jquery.flot.min.js"></script>
		<script src="__STATIC__/assets/js/flot/jquery.flot.pie.min.js"></script>
		<script src="__STATIC__/assets/js/flot/jquery.flot.resize.min.js"></script>

		<!-- ace scripts -->

		<script src="__STATIC__/assets/js/ace-elements.min.js"></script>
		<script src="__STATIC__/assets/js/ace.min.js"></script>

		<!-- inline scripts related to this page -->
<input type="file" style="display: none" id="excel"  value="" onchange="upExcel()">
<script>
	function upExcel(){
		var formData=new FormData();
		formData.append("file", document.getElementById("excel").files[0]);
		$.ajax({
			type: "POST",//方法类型
			url:"{:url('saler/inputExcel')}",//url
			data: formData,
			contentType: false,
			processData: false,
			success: function (result) {
				if (result.code == 1) {
					var content='共导入：'+result.data.all+"条数据 成功："+result.data.end+"条";
					alert(content);
					if(result.data.filename){
						window.location.href=result.data.filename
					}

				};
			},
			error: function () {
				alert("异常！");
			}
		});
	}

	function changeStatus(vs){
		var id=$(vs).data('id');
		var n_status=$(vs).data('status');
		if(n_status==1){
			var status=2;
		}else{
			var status=1;
		}
		$.ajax({
			url:"{:url('setStatus')}",
			type:"POST",
			data:{id:id,status:status},
			success:function (res){
				if(res.code==1){
					alert('修改成功');
				}else{
					alert('修改失败');
					window.location.reload();
				}

			}
		})
	}
	function del(vd)
	{
		var id=$(vd).data('id');
		var username=$(vd).data('username');
		if(confirm("是否删除"+username+"?")){
			$.ajax({
				url:"{:url('del')}",
				type:"POST",
				data:{id:id},
				success:function (res){
					if(res.code==1){
						alert('删除成功');
						window.location.reload();
					}else{
						alert('删除失败');

					}

				}
			})
		}
	}

</script>
</body>
</html>

